package cn.zyq.demo.system.config.consts.redis;

import cn.zyq.demo.system.config.consts.route.RoutePrefixConst;

import java.text.MessageFormat;

public class RedisMpKeys {
    /**
     * 获得小程序系统sessionid的key值
     *
     * @param token 业务id
     * @return
     */
    public static String SESSIONID_KEY(String token) {
        return RoutePrefixConst.mp + ".token:" + token;
    }

    /**
     * 获得消息未读数量
     *
     * @param userMpID 业务id
     * @return
     */
    public static String MESSAGE_UNREAD_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".msgUnread:" + userMpID;
    }

    /**
     * 获得聊天消息未读数量
     *
     * @param userMpID 业务id
     * @return
     */
    public static String CHAT_UNREAD_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".chatUnread:" + userMpID;
    }

    /**
     * 用户点赞动态
     *
     * @param userMpID 业务id
     * @return
     */
    public static String LIKE_BLOG_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".likeBlog:" + userMpID;
    }

    /**
     * 用户点赞二手信息
     *
     * @param userMpID 业务id
     * @return
     */
    public static String LIKE_USED_INFO_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".likeUsedInfo:" + userMpID;
    }

    /**
     * 用户点赞跑腿信息
     *
     * @param userMpID 业务id
     * @return
     */
    public static String LIKE_ERRAND_INFO_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".likeErrandInfo:" + userMpID;
    }

    /**
     * 用户点赞评论
     *
     * @param userMpID 业务id
     * @return
     */
    public static String LIKE_COMMENT_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".likeComment:" + userMpID;
    }

    /**
     * 用户收藏动态
     *
     * @param userMpID 业务id
     * @return
     */
    public static String COLLECT_BLOG_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".collectBlog:" + userMpID;
    }

    /**
     * 用户收藏二手信息
     *
     * @param userMpID 业务id
     * @return
     */
    public static String COLLECT_USED_INFO_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".collectUsedInfo:" + userMpID;
    }

    /**
     * 用户收藏跑腿信息
     *
     * @param userMpID 业务id
     * @return
     */
    public static String COLLECT_ERRAND_INFO_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".collectErrandInfo:" + userMpID;
    }

    /**
     * 用户拒绝的悄悄话发送人动态
     *
     * @param userMpID 业务id
     * @return
     */
    public static String REJECT_TALK_KEY(Integer userMpID) {
        return RoutePrefixConst.mp + ".rejectTalk:" + userMpID;
    }

    /**
     * 系统中的访问凭证
     *
     * @return
     */
    public static String ACCESS_TOKEN_KEY() {
        return RoutePrefixConst.mp + ".accessToken";
    }

    /**
     * 点击限制key
     *
     * @return
     */
    public static String ONE_CLICK_KEY(String scope, Integer userMpID) {
        return MessageFormat.format("{0}.oneClick.{1}:{2}", RoutePrefixConst.mp, scope, userMpID);
    }
}
